import request from '@/utils/request'
import { requestNew } from '@/utils/request'
import store from '@/stores/index.js'

// 可用余额
export async function available_amount(data) {
  return await request({
    url: '/commission/v1/open/income/available_amount',
    apiType:"commission",
    method: 'get',
    params: data || {}
  })
}
// 零售累计收益
export async function retail_cumulative(data) {
  return await request({
    url: '/commission/v1/open/income/retail_cumulative',
    apiType:"commission",
    method: 'get',
    params: data || {}
  })
}
// 碧划算累计收益
export async function bhs_cumulative(data) {
  return await request({
    url: '/commission/v1/open/income/bhs_cumulative',
    apiType:"commission",
    method: 'get',
    params: data || {}
  })
}
// 箱起累计收益
export async function box_cumulative(data) {
  return await request({
    url: '/box/integral/integral-info',
    method: 'get',
    params: data
  })
}
//余额明细列表
export async function remain_detail(data) {
  const res = await request({
    url: '/commission/v1/open/income/remain_detail',
    method: 'get',
    apiType:"commission",
    params:data
  })
  return res
}
//平台结算明细
export async function platform_settle_detail(data) {
  return await request({
    url: '/commission/v1/open/income/platform/settle_detail',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//邀请结算明细
export async function invite_settle_detail(data) {
  return await request({
    url: '/commission/v1/open/income/invite/settle_detail',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//提现结算明细
export async function withdraw_settle_detail(data) {
  return await request({
    url: '/commission/v1/open/income/withdraw/settle_detail',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//零售收益明细
export async function retail_cumulative_sent(data) {
  return await request({
    url: '/commission/v1/open/income/daily/retail_cumulative_sent',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//零售累计已发放明细
export async function income_retail_cumulative(data) {
  return await request({
    url: '/commission/v1/open/income/retail_cumulative_sent',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//碧划算累计已发放明细
export async function bhs_cumulative_sent(data) {
  return await request({
    url: '/commission/v1/open/income/bhs_cumulative_sent',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
//每日碧划算累计已发放明细
export async function daily_bhs_cumulative_sent(data) {
  return await request({
    url: '/commission/v1/open/income/daily/bhs_cumulative_sent',
    method: 'get',
    apiType:"commission",
    params:data
  })
}
// 碧划算返利，返利结算明细
export async function bhs_commission_record(params) {
  const res = await request({
    url: '/commission/v1/open/income/commission-record/search',
    method: 'post',
    apiType: 'commission',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params || {}
  })
  return res
}
//获取箱起用户可用积分和展示类型
export async function box_integral_detail(data) {
  return await request({
    url: '/box/integral/detail',
    method: 'get',
    params:data
  })
}
//获取用户可用积分和展示列表
export async function box_detail_list(data) {
  return await request({
    url: '/box/integral/detail-list',
    method: 'get',
    params:data
  })
}
//箱起累计收益
export async function box_income_list(data) {
  return await request({
    url: '/box/integral/income-list',
    method: 'get',
    params:data
  })
}